/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.sonrisas.tools.view;

import Complementos.Conexion_BD;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.JOptionPane;


/**
 *
 * @author UserToshiba
 */
public class frmMantenerPerfil extends javax.swing.JFrame {
        DefaultListModel modelo=new DefaultListModel();
        DefaultListModel modelo2=new DefaultListModel();
    
    public frmMantenerPerfil() {
        initComponents();
        cargarComboModulos();
        cargarComboPerfiles();
           
    }

   
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton2 = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        txtNombre = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        txtDescripcion = new javax.swing.JTextArea();
        btnRegistrar = new javax.swing.JButton();
        txtId = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        btnActualizar = new javax.swing.JButton();
        btnEliminar = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        comboPerfil = new javax.swing.JComboBox();
        jButton1 = new javax.swing.JButton();
        btnLimpiar = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        listItems = new javax.swing.JList();
        btnDer = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        listaItemsAsignados = new javax.swing.JList();
        btnDerall = new javax.swing.JButton();
        btnIzqall = new javax.swing.JButton();
        btnIzq = new javax.swing.JButton();
        checkVer = new javax.swing.JCheckBox();
        checkEditar = new javax.swing.JCheckBox();
        checkCrear = new javax.swing.JCheckBox();
        checkBorrar = new javax.swing.JCheckBox();
        checkImprimir = new javax.swing.JCheckBox();
        comboModulos = new javax.swing.JComboBox();
        btnAsignar = new javax.swing.JButton();
        btnLimpiame = new javax.swing.JButton();

        jButton2.setText("jButton2");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel1.setBackground(new java.awt.Color(204, 204, 255));
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Mantenimiento de Perfil", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tunga", 1, 24), new java.awt.Color(255, 255, 153))); // NOI18N

        jPanel2.setBackground(new java.awt.Color(204, 204, 255));
        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Datos de Perfil", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tunga", 1, 18), new java.awt.Color(255, 255, 153))); // NOI18N

        jLabel1.setText("Nombre:");

        jLabel2.setText("Descripcion:");

        txtNombre.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtNombreActionPerformed(evt);
            }
        });

        txtDescripcion.setColumns(7);
        txtDescripcion.setRows(5);
        jScrollPane1.setViewportView(txtDescripcion);

        btnRegistrar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/pe/sonrisas/tools/imagenes/comun/adduser1.png"))); // NOI18N
        btnRegistrar.setText("REGISTRAR");
        btnRegistrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnRegistrarActionPerformed(evt);
            }
        });

        txtId.setEditable(false);
        txtId.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtIdActionPerformed(evt);
            }
        });

        jLabel3.setText("ID:");

        btnActualizar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/pe/sonrisas/tools/imagenes/comun/update.png"))); // NOI18N
        btnActualizar.setText("ACTUALIZAR");
        btnActualizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnActualizarActionPerformed(evt);
            }
        });

        btnEliminar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/pe/sonrisas/tools/imagenes/comun/btnEliminar.png"))); // NOI18N
        btnEliminar.setText("ELIMINAR");
        btnEliminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEliminarActionPerformed(evt);
            }
        });

        jPanel4.setBackground(new java.awt.Color(204, 204, 255));
        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Buscar", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tunga", 1, 14), new java.awt.Color(255, 255, 153))); // NOI18N

        comboPerfil.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                comboPerfilItemStateChanged(evt);
            }
        });

        jButton1.setText("VER PERMISOS");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(comboPerfil, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(25, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(15, 15, 15)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(comboPerfil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 38, Short.MAX_VALUE))
                .addContainerGap(64, Short.MAX_VALUE))
        );

        btnLimpiar.setText("LIMPIAR");
        btnLimpiar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLimpiarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(77, 77, 77)
                        .addComponent(btnActualizar, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btnEliminar, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(43, 43, 43)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel2Layout.createSequentialGroup()
                                    .addComponent(jLabel2)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 209, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addComponent(jLabel3)
                                        .addComponent(jLabel1))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addGroup(jPanel2Layout.createSequentialGroup()
                                            .addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(72, 72, 72)
                                            .addComponent(btnLimpiar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                        .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 209, javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(43, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(btnRegistrar)
                .addGap(150, 150, 150))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(30, 30, 30)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3)
                    .addComponent(btnLimpiar))
                .addGap(16, 16, 16)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(48, 48, 48)
                        .addComponent(jLabel2)))
                .addGap(31, 31, 31)
                .addComponent(btnRegistrar, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 61, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnActualizar, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnEliminar, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(41, 41, 41))
        );

        jPanel3.setBackground(new java.awt.Color(204, 204, 255));
        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Permisos", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tunga", 1, 18), new java.awt.Color(255, 255, 153))); // NOI18N

        listItems.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                listItemsMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(listItems);

        btnDer.setText(">");
        btnDer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDerActionPerformed(evt);
            }
        });

        listaItemsAsignados.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                listaItemsAsignadosMouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(listaItemsAsignados);

        btnDerall.setText(">>");
        btnDerall.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDerallActionPerformed(evt);
            }
        });

        btnIzqall.setText("<<");
        btnIzqall.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnIzqallActionPerformed(evt);
            }
        });

        btnIzq.setText("<");
        btnIzq.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnIzqActionPerformed(evt);
            }
        });

        checkVer.setSelected(true);
        checkVer.setText("Ver");

        checkEditar.setSelected(true);
        checkEditar.setText("Editar");

        checkCrear.setSelected(true);
        checkCrear.setText("Crear");

        checkBorrar.setSelected(true);
        checkBorrar.setText("Borrar");

        checkImprimir.setSelected(true);
        checkImprimir.setText("Imprimir");

        comboModulos.setEnabled(false);
        comboModulos.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                comboModulosItemStateChanged(evt);
            }
        });

        btnAsignar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/pe/sonrisas/tools/imagenes/comun/check.png"))); // NOI18N
        btnAsignar.setText("ASIGNAR");
        btnAsignar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAsignarActionPerformed(evt);
            }
        });

        btnLimpiame.setText("LIMPIAR");
        btnLimpiame.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLimpiameActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(24, 24, 24)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(checkVer)
                                .addGap(18, 18, 18)
                                .addComponent(checkEditar))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGap(136, 136, 136)
                                .addComponent(checkCrear)
                                .addGap(18, 18, 18)
                                .addComponent(checkBorrar)
                                .addGap(28, 28, 28)
                                .addComponent(checkImprimir))))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(137, 137, 137)
                        .addComponent(btnAsignar, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnIzq, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnDerall, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btnIzqall, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btnDer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(25, 25, 25))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(comboModulos, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnLimpiame, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(46, 46, 46))))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(36, 36, 36)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(comboModulos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(btnLimpiame, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(45, 45, 45)
                                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 40, Short.MAX_VALUE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnDer)
                        .addGap(18, 18, 18)
                        .addComponent(btnIzq)
                        .addGap(43, 43, 43)
                        .addComponent(btnDerall)
                        .addGap(18, 18, 18)
                        .addComponent(btnIzqall)
                        .addGap(111, 111, 111)))
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(checkVer)
                    .addComponent(checkEditar)
                    .addComponent(checkBorrar)
                    .addComponent(checkCrear)
                    .addComponent(checkImprimir))
                .addGap(45, 45, 45)
                .addComponent(btnAsignar, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(43, 43, 43))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(19, 19, 19))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(0, 41, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void txtNombreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNombreActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtNombreActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton2ActionPerformed

    private void btnDerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDerActionPerformed
          pasarUno(listItems, modelo,listaItemsAsignados,modelo2);    
    }//GEN-LAST:event_btnDerActionPerformed

    private void btnRegistrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRegistrarActionPerformed
        try {
            Conexion_BD conexion=new Conexion_BD();
            
            conexion.Conectar();
            
            //Obtenemos los datos de los campos
            
            String nombre = txtNombre.getText();
            String descri = txtDescripcion.getText();
            
            conexion.insupdel("INSERT INTO PERFIL (nombre,descripcion,idUsuario) values ('"+nombre+"','"+descri+"',1)");
            
            
            //MOSTRAR MENSAJE
            JOptionPane.showMessageDialog(this, "SE REGISTRO EL PERFIL");
           
            txtNombre.setText("");
            txtDescripcion.setText("");
            
            
            
            try {
                conexion.Desconectar();
            } catch (Exception ex) {
                Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
            }
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
        }
       
    }//GEN-LAST:event_btnRegistrarActionPerformed

        private void btnActualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnActualizarActionPerformed
        try {
            Conexion_BD conexion = new Conexion_BD();
            
            conexion.Conectar();
            
            //String nuevo = txtBuscar.getText();
            int id = Integer.parseInt(txtId.getText());
            String nombre = txtNombre.getText();
            String descripcion = txtDescripcion.getText();
            
            conexion.insupdel("UPDATE PERFIL SET nombre = '"+nombre+"', descripcion = '"+descripcion+"' where id ='"+id+"'");
            
            JOptionPane.showMessageDialog(this, "SE ACTUALIZO CORRECTAMENTE");
            
            
            comboPerfil.removeAllItems();
            cargarComboPerfiles();            
            comboPerfil.setSelectedIndex(0);
            txtId.setText("");
            txtNombre.setText("");
            txtDescripcion.setText("");
            
            try {
                conexion.Desconectar();
            } catch (Exception ex) {
                Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
            }
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        
            
            
            
            
            
    }//GEN-LAST:event_btnActualizarActionPerformed

    private void btnEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarActionPerformed
        try {
            Conexion_BD conexion  = new Conexion_BD();
            
            conexion.Conectar();
            
            String nombre = txtNombre.getText();
            
            conexion.insupdel("DELETE FROM PERFIL WHERE nombre='"+nombre+"'");
            
            JOptionPane.showMessageDialog(this, "SE HA ELIMINADO SATISFACTORIAMENTE");
            comboPerfil.removeAllItems();
            cargarComboPerfiles();            
          //  txtBuscar.setText("");
            txtNombre.setText("");
            txtDescripcion.setText("");
         //   txtBuscar.requestFocus();
           
            try {
                conexion.Desconectar();
            } catch (Exception ex) {
                Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
            }
            
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        txtId.setText("");
        comboPerfil.removeAllItems();
        cargarComboPerfiles();
        
    }//GEN-LAST:event_btnEliminarActionPerformed

    private void comboModulosItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_comboModulosItemStateChanged
                modelo.clear();
                listItems.setModel(modelo);
                cargarListaItem(comboModulos.getSelectedIndex());
    }//GEN-LAST:event_comboModulosItemStateChanged

    private void btnIzqActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnIzqActionPerformed
        pasarUno(listaItemsAsignados, modelo2,listItems,modelo);
    }//GEN-LAST:event_btnIzqActionPerformed

    private void btnDerallActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDerallActionPerformed
        pasarTodo(modelo, modelo2, listaItemsAsignados);
    }//GEN-LAST:event_btnDerallActionPerformed

    private void btnIzqallActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnIzqallActionPerformed
        pasarTodo(modelo2, modelo, listItems);
    }//GEN-LAST:event_btnIzqallActionPerformed

    private void txtIdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtIdActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtIdActionPerformed

    private void btnAsignarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAsignarActionPerformed

        
        
        try {
            Conexion_BD conexion  = new Conexion_BD();
            conexion.Conectar();
            ResultSet modulo_rs = null;
            ResultSet item_rs = null;
            
            /*ID PERFIL*/
           int id_perfil = Integer.parseInt(txtId.getText());
           
           
           String modulo = comboModulos.getSelectedItem().toString();
           
           modulo_rs = conexion.Consultar("select idModulo from modulo where nombre = '"+modulo+"'");
           modulo_rs.next();
           
           /* ID DEL MODULO */
           int idModulo = modulo_rs.getInt(1);
           
            String nombre_item = listaItemsAsignados.getSelectedValue().toString();
           
           item_rs = conexion.Consultar("select id from item where nombreOpcion = '"+nombre_item+"'");
           item_rs.next();
           
           /* ID DEL ITEM*/
           int  id_item = item_rs.getInt(1);
           
           /*AQUI EVALUAMOS LOS CHECK*/
           
           int ver=0, editar=0, crear=0, borrar=0, imprimir=0;
           
           if (checkVer.isSelected()){
               ver=1;
           }
                   
           if (checkEditar.isSelected()){
               editar=1;
           }
           
           if (checkCrear.isSelected()){
               crear=1;
           }
           
           if (checkBorrar.isSelected()){
               borrar=1;
           }
                   
           if (checkImprimir.isSelected()){
               imprimir=1;
           }
          
           
           /* HACER EL INSERT A LA TABLA PRIVILEGIOS */
           
           ResultSet filas =null;
           filas = conexion.Consultar("select count(item_id) from privilegio where Item_id ="+id_item+" and Perfil_id = "+id_perfil+"");
           filas.next();
           
           int existe = filas.getInt(1);
            
           if (existe==0){
               JOptionPane.showMessageDialog(this, "No existe el privilegio");
               conexion.insupdel("INSERT INTO privilegio (Perfil_id, Item_id, ver, editar, crear, borrar, imprimir) VALUES ("+id_perfil+","+id_item+","+ver+","+editar+","+crear+","+borrar+","+imprimir+")");
               JOptionPane.showMessageDialog(this, "SE ASIGNO EL PERMISO SATISFACTORIAMENTE");
           }
           else{
               conexion.insupdel("UPDATE privilegio SET ver="+ver+",editar="+editar+",crear="+crear+",borrar="+borrar+",imprimir="+imprimir+" WHERE Perfil_id="+id_perfil+" and Item_id="+id_item+"");
               JOptionPane.showMessageDialog(this, "SE ACTUALIZO EL PERMISO SATISFACTORIAMENTE");
           }
           
    /*     checkVer.setSelected(true);
           checkEditar.setSelected(true);
           checkCrear.setSelected(true);
           checkBorrar.setSelected(true);
           checkImprimir.setSelected(true);          */
           
           
           pasarTodo(modelo2, modelo, listItems);
           
   
            
        } catch (Exception e) {
            System.out.println(""+e.getMessage());
        }
        
        
    }//GEN-LAST:event_btnAsignarActionPerformed

    private void listaItemsAsignadosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_listaItemsAsignadosMouseClicked
        
         try {
             Conexion_BD conexion  = new Conexion_BD();
             conexion.Conectar();
             ResultSet modulo_rs = null;
             ResultSet item_rs = null;
             ResultSet permiso_rs=null;
             
             /*ID PERFIL*/
            int id_perfil = Integer.parseInt(txtId.getText());
            
            
            String modulo = comboModulos.getSelectedItem().toString();
            
            modulo_rs = conexion.Consultar("select idModulo from modulo where nombre = '"+modulo+"'");
            modulo_rs.next();
            
            /* ID DEL MODULO */
            int idModulo = modulo_rs.getInt(1);
            
            String nombre_item = listaItemsAsignados.getSelectedValue().toString();
            
            item_rs = conexion.Consultar("select id from item where nombreOpcion = '"+nombre_item+"'");
            item_rs.next();
            
            /* ID DEL ITEM*/
            int  id_item = item_rs.getInt(1);
            
            
            
            /* CONSULTAMOS SI LOS PERMISOS ESTAN EN (0) o (1) */
            
            String query = "SELECT ver, editar, crear, borrar, imprimir FROM privilegio WHERE Perfil_id="+id_perfil+" and Item_id="+id_item;
             System.out.println("QUERY: "+query);
            permiso_rs=conexion.Consultar(query);
            permiso_rs.next();
            
            
         /* System.out.println(permiso_rs.getInt("ver"));
            System.out.println(permiso_rs.getInt("editar"));
            System.out.println(permiso_rs.getInt("crear"));
            System.out.println(permiso_rs.getInt("borrar"));
            System.out.println(permiso_rs.getInt("imprimir"));  */
            
            
                       
            /* EVALUAMOS LOS CHECK (PERMISOS) */
            
            if(permiso_rs.getInt("ver")==1){
               checkVer.setSelected(true); 
            }   
            else {
               checkVer.setSelected(false); 
            }
            
            if(permiso_rs.getInt("editar")==1){
               checkEditar.setSelected(true); 
            }   
            else {
               checkEditar.setSelected(false); 
            }
            
            if(permiso_rs.getInt("crear")==1){
               checkCrear.setSelected(true); 
            }   
            else {
               checkCrear.setSelected(false); 
            }
            
            if(permiso_rs.getInt("borrar")==1){
               checkBorrar.setSelected(true); 
            }   
            else {
               checkBorrar.setSelected(false); 
            }
            
            if(permiso_rs.getInt("imprimir")==1){
               checkImprimir.setSelected(true); 
            }   
            else {
               checkImprimir.setSelected(false); 
            }
          
           
            
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        
    }//GEN-LAST:event_listaItemsAsignadosMouseClicked

    /* OBSERVACION*/
    
    
    private void listItemsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_listItemsMouseClicked
        
        try {
             Conexion_BD conexion  = new Conexion_BD();
             conexion.Conectar();
             ResultSet modulo_rs = null;
             ResultSet item_rs = null;
             ResultSet permiso_rs=null;
             
             /*ID PERFIL*/
            int id_perfil = Integer.parseInt(txtId.getText());
            
            
            String modulo = comboModulos.getSelectedItem().toString();
            
            modulo_rs = conexion.Consultar("select idModulo from modulo where nombre = '"+modulo+"'");
            modulo_rs.next();
            
            /* ID DEL MODULO */
            int idModulo = modulo_rs.getInt(1);
            
            String nombre_item = listItems.getSelectedValue().toString();
            
            item_rs = conexion.Consultar("select id from item where nombreOpcion = '"+nombre_item+"'");
            item_rs.next();
            
            /* ID DEL ITEM*/
            int  id_item = item_rs.getInt(1);
            
            
            
            /* CONSULTAMOS SI LOS PERMISOS ESTAN EN (0) o (1) */
            
            permiso_rs=conexion.Consultar("SELECT ver, editar, crear, borrar, imprimir FROM privilegio WHERE Perfil_id="+id_perfil+" and Item_id="+id_item+"");
            permiso_rs.next();
            
            
         /* System.out.println(permiso_rs.getInt("ver"));
            System.out.println(permiso_rs.getInt("editar"));
            System.out.println(permiso_rs.getInt("crear"));
            System.out.println(permiso_rs.getInt("borrar"));
            System.out.println(permiso_rs.getInt("imprimir"));  */
            
            
                       
            /* EVALUAMOS LOS CHECK (PERMISOS) */
            
            if(permiso_rs.getInt("ver")==1){
               checkVer.setSelected(true); 
            }   
            else {
               checkVer.setSelected(false); 
            }
            
            if(permiso_rs.getInt("editar")==1){
               checkEditar.setSelected(true); 
            }   
            else {
               checkEditar.setSelected(false); 
            }
            
            if(permiso_rs.getInt("crear")==1){
               checkCrear.setSelected(true); 
            }   
            else {
               checkCrear.setSelected(false); 
            }
            
            if(permiso_rs.getInt("borrar")==1){
               checkBorrar.setSelected(true); 
            }   
            else {
               checkBorrar.setSelected(false); 
            }
            
            if(permiso_rs.getInt("imprimir")==1){
               checkImprimir.setSelected(true); 
            }   
            else {
               checkImprimir.setSelected(false); 
            }
          
           
            
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
        }
        
      
    }//GEN-LAST:event_listItemsMouseClicked

    private void btnLimpiarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLimpiarActionPerformed
          limpiar();
    }//GEN-LAST:event_btnLimpiarActionPerformed

    private void btnLimpiameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLimpiameActionPerformed
        
        modelo2.removeAllElements();       
        comboModulos.removeAllItems();
        cargarComboModulos();
        checkVer.setSelected(true);
        checkEditar.setSelected(true);
        checkCrear.setSelected(true);
        checkBorrar.setSelected(true);
        checkImprimir.setSelected(true);
        
    }//GEN-LAST:event_btnLimpiameActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        
        if(comboPerfil.getSelectedIndex()!=0){
        frmVisualizarPermisos objeto=new frmVisualizarPermisos();
        
        objeto.setVisible(true);
        objeto.setCodigo(txtId.getText());  
        }else{
            JOptionPane.showMessageDialog(this, "Seleccione un perfil"); 
        }       
        
        
    }//GEN-LAST:event_jButton1ActionPerformed

    private void comboPerfilItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_comboPerfilItemStateChanged
          
               
        try {
            Conexion_BD conexion=new Conexion_BD();
                
                conexion.Conectar();
        
                if (comboPerfil.getSelectedItem().toString()=="Seleccione"){
                
                    txtId.setText("");               
                    txtNombre.setText("");
                    txtDescripcion.setText("");
                    comboModulos.setEnabled(false);
            }else{
                comboModulos.setEnabled(true);
                }
                
                
                String opcion = comboPerfil.getSelectedItem().toString();
                ResultSet datos = null;
                
                String query="select * from perfil where nombre ='"+opcion+"'";
                datos = conexion.Consultar(query);
                
                while(datos.next()){
                        
                    txtId.setText(datos.getString(1));
                    txtNombre.setText(datos.getString(2));
                    txtDescripcion.setText(datos.getString(3));
                    
                }
                
                
            try {
                conexion.Desconectar();
            } catch (Exception ex) {
                Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
            }
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
        }
           
    }//GEN-LAST:event_comboPerfilItemStateChanged
      
    
    
    
    
    
    
    
    
    
    
  public void cargarComboModulos() {
        try {
             Conexion_BD co=new Conexion_BD();
             ResultSet rs = null;
             ResultSet modulo_rs = null;
             //ResultSet item_rs = null;
             co.Conectar();
            
            
            
           // String modulo = comboModulos.getSelectedItem().toString();
            
            modulo_rs = co.Consultar("select idModulo,nombre from modulo");
            //modulo_rs.next();   
            
//            String query = "select nombreOpcion from  item where idModulo='"+id_perfil+"'";
//            rs = co.Consultar(query);
            
            comboModulos.addItem("Seleccione");
            
            while(modulo_rs.next()){
                comboModulos.addItem(modulo_rs.getString(2));
            }
            
            
            
            try {
                co.Desconectar();
            } catch (Exception ex) {
                Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
            }
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
        }            
               
        
        
    }

    public void cargarListaItem(int modulo) {
        try {
            Conexion_BD co = new Conexion_BD();
            ResultSet rs = null;
            
            co.Conectar();
            String query = "select idModulo,nombreOpcion from item where idModulo = '"+modulo+"'";
            System.out.println(query);
            rs = co.Consultar(query);
            
           
           
           while(rs.next()){
               modelo.addElement(rs.getString(2));
              
           
           }
           
           listItems.setModel(modelo);
            
           
           try {
                co.Desconectar();
           
            } catch (Exception ex) {
                Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
            }
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
        } 
        
    }
    
    
    public void pasarUno(JList listaA, DefaultListModel a, JList listaB, DefaultListModel b){
        int ind;
        String nombre;
        ind=listaA.getSelectedIndex();
        if(ind==-1)
            JOptionPane.showMessageDialog(this, "Seleccione un item");
        else{           
            nombre=a.getElementAt(ind).toString();
            b.addElement(nombre);
            listaB.setModel(b);
            a.remove(ind);
        }
    }
    
    public void pasarTodo(DefaultListModel modeloA, DefaultListModel modeloB,
                            JList lista){
        int n;
        String dato;
        n=modeloA.getSize();
        for(int i=0; i<n; i++){
            dato=modeloA.getElementAt(i).toString();
            modeloB.addElement(dato);
            lista.setModel(modeloB);
        }
        modeloA.removeAllElements();
    }  
    
    public void cargarComboPerfiles() {
        try {
            Conexion_BD co = new Conexion_BD();
                ResultSet rs = null;
                
                co.Conectar();
                
                String query = "select id,nombre from perfil";
                System.out.println(query);
                rs = co.Consultar(query);
            
                comboPerfil.addItem("Seleccione");
                
                while(rs.next()){
                    comboPerfil.addItem(rs.getString(2));
                }
            try {
                co.Desconectar();
            } catch (Exception ex) {
                Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
            }
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMantenerPerfil.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }
    
    
    public void limpiar(){
        comboPerfil.removeAllItems();
        cargarComboPerfiles();
        txtId.setText("");
        txtNombre.setText("");
        txtDescripcion.setText("");
    }
    
    
    
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(frmMantenerPerfil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(frmMantenerPerfil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(frmMantenerPerfil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(frmMantenerPerfil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new frmMantenerPerfil().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnActualizar;
    private javax.swing.JButton btnAsignar;
    private javax.swing.JButton btnDer;
    private javax.swing.JButton btnDerall;
    private javax.swing.JButton btnEliminar;
    private javax.swing.JButton btnIzq;
    private javax.swing.JButton btnIzqall;
    private javax.swing.JButton btnLimpiame;
    private javax.swing.JButton btnLimpiar;
    private javax.swing.JButton btnRegistrar;
    private javax.swing.JCheckBox checkBorrar;
    private javax.swing.JCheckBox checkCrear;
    private javax.swing.JCheckBox checkEditar;
    private javax.swing.JCheckBox checkImprimir;
    private javax.swing.JCheckBox checkVer;
    private javax.swing.JComboBox comboModulos;
    private javax.swing.JComboBox comboPerfil;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JList listItems;
    private javax.swing.JList listaItemsAsignados;
    private javax.swing.JTextArea txtDescripcion;
    private javax.swing.JTextField txtId;
    private javax.swing.JTextField txtNombre;
    // End of variables declaration//GEN-END:variables

    

    

    
}
